{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "765ae4fb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "账号:LLL\n",
      "密码:12345\n",
      "LLL\n",
      "12345\n"
     ]
    }
   ],
   "source": [
    "username = input(\"账号:\")\n",
    "password = input(\"密码:\")\n",
    "\n",
    "print(username)\n",
    "print(password)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "162fb805",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "账号:LLL\n",
      "密码:353234\n",
      "账号不存在或密码不正确!\n"
     ]
    }
   ],
   "source": [
    "user1 = \"LLL\"\n",
    "password1 = \"12345\"\n",
    "\n",
    "username = input(\"账号:\")\n",
    "password = input(\"密码:\")\n",
    "\n",
    "if user1 == username and password1 == password:\n",
    "    print(\"欢迎\"+user1+\"登录！\")\n",
    "    \n",
    "else:\n",
    "    print(\"账号不存在或密码不正确!\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "9c092254",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "账号:LLL\n",
      "密码:14234\n",
      "账号不存在或密码不正确!\n",
      "您还有2次尝试的机会\n",
      "账号:LLL\n",
      "密码:1343124312\n",
      "账号不存在或密码不正确!\n",
      "您还有1次尝试的机会\n",
      "账号:WR\n",
      "密码:13\n",
      "三次输入失败，请1小时后再来尝试\n"
     ]
    }
   ],
   "source": [
    "user1 = \"LLL\"\n",
    "password1 = \"12345\"\n",
    "\n",
    "for i in range(3,0,-1):\n",
    "    username = input(\"账号:\")\n",
    "    password = input(\"密码:\")\n",
    "\n",
    "    if user1 == username and password1 == password:\n",
    "        print(\"欢迎\"+user1+\"登录！\")\n",
    "        break \n",
    "    else:\n",
    "        if i == 1:\n",
    "            print(\"三次输入失败，请1小时后再来尝试\")\n",
    "        else:\n",
    "            print(\"账号不存在或密码不正确!\")\n",
    "            print(\"您还有\"+str(i-1)+\"次尝试的机会\") "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "48b6203f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "姓名：CXK\n",
      "年龄：2.5\n",
      "工作：偶像练习生\n",
      "收入：1000000\n",
      "地区：美国\n",
      "-----INFO OF CXK------\n",
      "年龄：2.5\n",
      "工作：偶像练习生\n",
      "收入：1000000\n",
      "地区：美国\n"
     ]
    }
   ],
   "source": [
    "name = input(\"姓名：\")\n",
    "age = input(\"年龄：\")\n",
    "job = input(\"工作：\")\n",
    "salary = input(\"收入：\")\n",
    "reg = input(\"地区：\")\n",
    "\n",
    "info = '''-----INFO OF '''+ name +'''------'''+'''\n",
    "年龄：'''+age+'''\n",
    "工作：'''+job+'''\n",
    "收入：'''+salary+'''\n",
    "地区：'''+reg\n",
    "\n",
    "print(info)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "b8d238ca",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "年龄：3\n",
      "3 <class 'str'>\n"
     ]
    }
   ],
   "source": [
    "age = input(\"年龄：\")\n",
    "print(age,type(age))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "8e5f6553",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "姓名：CXK\n",
      "年龄：3\n",
      "工作：IT\n",
      "收入：10000\n",
      "地区：广州\n",
      "-----INFO OF CXK------\n",
      "姓名：CXK\n",
      "年龄：3\n",
      "工作：IT\n",
      "收入：10000\n",
      "地区：广州\n"
     ]
    }
   ],
   "source": [
    "name = input(\"姓名：\")\n",
    "age = int(input(\"年龄：\"))\n",
    "job = input(\"工作：\")\n",
    "salary = input(\"收入：\")\n",
    "reg = input(\"地区：\")\n",
    "\n",
    "info = '''-----INFO OF %s------\n",
    "姓名：%s\n",
    "年龄：%d\n",
    "工作：%s\n",
    "收入：%s\n",
    "地区：%s'''%(name,name,age,job,salary,reg)\n",
    "print(info)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "81afe224",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "姓名：123\n",
      "年龄：132\n",
      "工作：\n",
      "收入：132\n",
      "地区：1323\n",
      "-----INFO OF 123------\n",
      "姓名：123\n",
      "年龄：132\n",
      "工作：\n",
      "收入：132\n",
      "地区：1323\n"
     ]
    }
   ],
   "source": [
    "name = input(\"姓名：\")\n",
    "age = int(input(\"年龄：\"))\n",
    "job = input(\"工作：\")\n",
    "salary = input(\"收入：\")\n",
    "reg = input(\"地区：\")\n",
    "\n",
    "info = '''-----INFO OF {姓名}------\n",
    "姓名：{姓名}\n",
    "年龄：{年龄}\n",
    "工作：{工作}\n",
    "收入：{收入}\n",
    "地区：{地区}'''.format(年龄 = age,姓名 = name,工作 = job,收入 = salary, 地区 = reg)\n",
    "print(info)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f2a1579a",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
